<?php
$css_path = "layout/css";
$js_path = "layout/js";
$images_path = "layout/images";
$root_dir = "/p02/";
$root_url = 'http://' . $_SERVER['HTTP_HOST'];
$root_link = $root_url . '/';
$title = 'Journals';

include dirname(__FILE__) . '/layers/bll/publication_bll.php';

//$journals = loadAllJournals();
if (!empty($_GET['p'])) {
    $current_page = $_GET['p'];
} else {
    $current_page = 1;
}
$page_size = 5;
$total_page = get_total_page_journals_bll($page_size);
$journals = get_current_page_journals_bll($current_page, $page_size);
?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="Content-type" value="text/html; charset=UTF-8" />
        <title><?php echo $title ?> - Tesdo</title>
        <link href="<?php echo $root_link ?>layout/css/chromestyle4.css" rel="stylesheet" />
        <link href="<?php echo $root_link ?>layout/css/common.css" rel="stylesheet" />
        <script src="<?php echo $root_link ?>layout/js/chrome.js"></script>
        <link href="<?php echo $root_link ?>layout/images/favicon.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
    </head>
    <body>
        <?php require_once dirname(__FILE__) . '/includes/header.php'; ?>
        <!-- Body -->
        <div id="body">
            <section class="content-wrapper main-content clear-fix">
                <div class="container-col-w-sidebar">
                    <h1 class="main-h1">Publication Opportunities</h1>
                </div>
                <div class="clear"></div>
                <div class="container-col-w-sidebar">
                    <!-- Content -->
                    <div id="post-602" class="post-602 page type-page status-publish hentry">
                        <p style="text-align: center;">Three special issues on different themes will be published in the following Journals.</p>

                        <?php
                        foreach ($journals as $i => $item) {
                            ?>
                            <h5>
                                <a href="journal_detail.php?id=<?php echo $item['JournalID']; ?>&cat" class="hr" onmouseover="none" style="color: #335EBE;">
                                <?php echo $item['Title']; ?>
                                </a>
                            </h5>
                            <p style="text-align: justify;">
                                <a target="_blank" href="journal_detail.php?id=<?php echo $item['JournalID']; ?>&cat" title="<?php echo $item['Title'] ?>">
                                    <img width="88" height="123" src="<?php echo $root_link ?>layout/images/journal_images/<?php echo $item['Photo']; ?>" alt="journals" class="alignleft size-full wp-image-844">
                                </a>
                                <?php echo $item['ShortDescription']; ?>
                            </p>
                            <p style="text-align: left;">
                                ISSN: <?php echo $item['PrintISSN']; ?> (print)<br>
                                ISSN: <?php echo $item['OnlineISSN']; ?> (online)<br>
                                <?php if (!empty($item['ImpactFactor'])) { ?>
                                    <strong>Impact Factor: <?php echo $item['ImpactFactor']; ?></strong>
                                <?php } ?>
                            </p>
                            <div class="clear"></div>
                            <?php
                        }
                        ?>
                    </div>
                    <!-- /Content -->
                </div>
                <table width="100%">
                    <tbody>
                        <tr>
                            <td id="MainContent_paging" align="center">
                                <ul>
                                    <?php
                                    for ($i = 1; $i < $total_page; $i++) 
                                    {
                                    ?>
                                    <li><a href="publication.php?p=<?php echo $i; ?>"><?php echo $i; ?></a></li>
                                    <?php }
                                    ?>
                                    </ul>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    <br clear="All" />
                    <br clear="All" />
                </section>
            </div>
            <!-- End Body -->

            <?php require_once dirname(__FILE__) . '/includes/footer.php'; ?>
    </body>
</html>